# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-vistir
pkgver=0.8.0
pkgrel=2
pkgdesc="Miscellaneous utilities for dealing with filesystems, paths, projects, subprocesses, and more"
url="https://github.com/sarugaku/vistir"
license=('BSD')
arch=('any')
depends=('python-colorama')
makedepends=('python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'python-hypothesis-fspaths' 'python-pytest-timeout' 'python-requests')
source=("$pkgname-$pkgver.tar.gz::https://github.com/sarugaku/vistir/archive/v$pkgver.tar.gz")
sha512sums=('e417b4e43b71679c4e74ccca2156ff2bdff5180479f8af22a70a359e0e864ba80c0cb2e7bae1a1766280c84b8c02f06be79ae090a3ae8883cc73891bd3f77b44')

build() {
  cd vistir-$pkgver
  python setup.py build
}

check() {
  cd vistir-$pkgver
  PYTHONPATH="$PWD/build/lib" pytest
}

package() {
  cd vistir-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
